import request from '@/utils/request'

export const getFutuAccountList = () => {
  return request({
    url: '/trading/accounts',
    method: 'get'
  })
}

export const getFutuFundInfo = () => {
  return request({
    url: '/trading/info',
    method: 'get'
  })
}

export const getFutuHolding = (data) => {
  return request({
    url: '/trading/getPositionList',
    method: 'post',
    data: { ...data }
  })
}

export const getFutuMaxBuySell = (data) => {
  return request({
    url: '/trading/getAccTradingInfo',
    method: 'post',
    data: { ...data }
  })
}

export const getFutuOrderList = (params) => {
  return request({
    url: '/trading/orders',
    method: 'get',
    params: { ...params }
  })
}

export const getFutuOrderFeeList = (code) => {
  return request({
    url: '/trading/getOrdersFee',
    method: 'get',
    params: code
  })
}

export const getFutuDealList = (params) => {
  return request({
    url: '/trading/history_deal',
    method: 'post',
    params: { ...params }
  })
}

export const getFutuDealListToday = (code) => {
  return request({
    url: '/trading/today_deal',
    method: 'get',
    params: code
  })
}
